﻿#region | Copyright © 2556 |

/*
##########################################################################
	Author By : Siriwat Suananpornpanit
	DateTime : 2556/08/30
##########################################################################
*/

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Modal;

namespace Web.Pages
{
    public partial class FunctionGroup : System.Web.UI.Page
    {
        #region | InitAccess |

        public void InitAccess()
        {
            // Init Access
            AccessToolbar.Resource = "Resource";
            //
            AccessToolbar.AddText = "Add";
            AccessToolbar.EditText = "Edit";
            AccessToolbar.CopyText = "Copy";
            AccessToolbar.DeleteText = "Delete";
            AccessToolbar.SearchText = "Search";
            //
            AccessToolbar.SaveVisible = false;
            AccessToolbar.CancelVisible = false;
            AccessToolbar.AddClick += OnAddClick;
            AccessToolbar.EditClick += OnEditClick;
            AccessToolbar.CopyClick += OnCopyClick;
            AccessToolbar.DeleteClick += OnDeleteClick;
            AccessToolbar.SearchClick += OnSearchClick;
        }

        void OnSearchClick(object sender, EventArgs e)
        {
            // Response.Write("Search");
        }

        void OnDeleteClick(object sender, EventArgs e)
        {
            // Response.Write("Delete");
        }

        void OnCopyClick(object sender, EventArgs e)
        {
            FunctionGroupModal.OnLoad(Core.AccessFlag.Copy);
            pcModal.HeaderText = Core.ResourceTools.GetResource(resourceKey: "FunctionGroupAdd");
        }

        void OnEditClick(object sender, EventArgs e)
        {
            FunctionGroupModal.OnLoad(Core.AccessFlag.Edit);
            pcModal.HeaderText = Core.ResourceTools.GetResource(resourceKey: "FunctionGroupEdit");
        }

        void OnAddClick(object sender, EventArgs e)
        {
            FunctionGroupModal.OnLoad(Core.AccessFlag.Add);
            pcModal.HeaderText = Core.ResourceTools.GetResource(resourceKey: "FunctionGroupAdd");
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            InitAccess();
            //
        }

    }
}